package com.bob.like.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bob.like.constant.UserConstant;
import com.bob.like.model.entity.User;
import com.bob.like.service.UserService;
import com.bob.like.mapper.UserMapper;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
* @author bobzhou
* @description 针对表【user】的数据库操作Service实现
* @createDate 2025-04-24 15:03:46
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User getLoginUser(HttpServletRequest request) {
        // 先判断是否已登录
        User user = (User) request.getSession().getAttribute(UserConstant.LOGIN_USER);
        return user;
    }
}




